WebIntegrationProcessor{
  WBL=new ListenerMetaData();
  WBL.setListenerClass(WELD_LISTENER);
  JIL=new ListenerMetaData();
  JIL.setListenerClass(JSP_LISTENER);
  CPF=new FilterMetaData();
  CPF.setAsyncSupported(true);
  CPFM=new FilterMappingMetaData();
}
deploy{
  final DeploymentUnit deploymentUnit=phaseContext.getDeploymentUnit();
  final EEModuleDescription module=deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
  final EEApplicationClasses applicationClasses=deploymentUnit.getAttachment(Attachments.EE_APPLICATION_CLASSES_DESCRIPTION);
  if (!DeploymentTypeMarker.isType(DeploymentType.WAR,deploymentUnit)) {
    return;
  if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
    return;
  WarMetaData warMetaData=deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
  if (warMetaData == null) {
  JBossWebMetaData webMetaData=warMetaData.getMergedJBossWebMetaData();
  if (webMetaData == null) {
  List<ListenerMetaData> listeners=webMetaData.getListeners();
    listeners=new ArrayList<ListenerMetaData>();
    webMetaData.setListeners(listeners);
    final ListIterator<ListenerMetaData> iterator=listeners.listIterator();
    while (iterator.hasNext()) {
      final ListenerMetaData listener=iterator.next();
      if (listener.getListenerClass().trim().equals(WELD_SERVLET_LISTENER)) {
        iterator.remove();
  listeners.add(1,JIL);
  final WebComponentDescription componentDescription=new WebComponentDescription(JSP_LISTENER,JSP_LISTENER,module,deploymentUnit.getServiceName(),applicationClasses);
  module.addComponent(componentDescription);
  final Map<String,ComponentInstantiator> instantiators=deploymentUnit.getAttachment(WebAttachments.WEB_COMPONENT_INSTANTIATORS);
  instantiators.put(JSP_LISTENER,new WebComponentInstantiator(deploymentUnit,componentDescription));
  FiltersMetaData filters=webMetaData.getFilters();
    filters=new FiltersMetaData();
    webMetaData.setFilters(filters);
  filters.add(CPF);
  List<FilterMappingMetaData> filterMappings=webMetaData.getFilterMappings();
  if (filterMappings == null) {
    filterMappings=new ArrayList<FilterMappingMetaData>();
    webMetaData.setFilterMappings(filterMappings);
  filterMappings.add(CPFM);
}
undeploy{ }
